<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>广告新增页面</title>
	    <link href="/stylesheets/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
	    <link href="/stylesheets/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
	    <link href="/stylesheets/common.css" rel="stylesheet">
	    <link href="/stylesheets/webcss.css"  rel="stylesheet"/>
	</head>
	<body>
		<div class="advertisement-box mt30">
			<ul>
				<li><div class="left">类型</div><div class="right"><span class="pl10 pr10"><input type="radio" name="one">首页图</span><span class="pl10 pr10"><input type="radio" name="one">科目一</span></div></li>
				<li><div class="left">标题(仅供查询)</div><div class="right">5.1百店购机大狂欢</div></li>
				<li><div class="left">
					<p class="mgNone"><span class="red pr5">*</span>上传图片</p>
					<p class="mgNone">上传尺寸:</p>
				</div>
				<div class="right">
					<div class="show-img"></div>
					<p class="mgNone"><input type="file" name="pic" id="pic" value=""/></p>
				</div>
				</li>
				<li><div class="left"><p class="mgNone"><span class="red pr5">*</span>顺序</p></div><div class="right"><input type="text"></div></li>
				<li><div class="left"><p class="mgNone">跳转设定(是否需要)</p></div><div class="right"></div></li>
			</ul>
			<div class="btn_box mt20"><input type="button" value="确定保存" class="btn btn-primary pl10 pr10" id="new"></div>
	</div>
		 <script src="/javascripts/jquery.min.js?v=2.1.4"></script>
		 <script type="text/javascript">
		 	function getObjectURL(file) {
		        var url = null;
		        if (window.createObjectURL != undefined) {
		            url = window.createObjectURL(file)
		        } else if (window.URL != undefined) {
		            url = window.URL.createObjectURL(file)
		        } else if (window.webkitURL != undefined) {
		            url = window.webkitURL.createObjectURL(file)
		        }
		        return url
		    };
		    $(function(){
		 	$("#new").click(function(){
		 		var data = $("#pic").val();
		 		alert(data);
		 		$.ajax({
		 			type:"post",
		 			url:"/new_advertisement/new",
		 			async:true,
		 			data:data,
		 			success:function(msg){
		 				alert(msg.message);
		 			}
		 		});
		 	});
		 	})
		 </script>
	</body>
</html>
